1.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If699bfd90f2a8d80ac93c51220707c856e94f8db
Code Smell Term: circular dependency
Code Smell Discussions: 
1)	Reviewer: something to discuss - if this is made a part of the parent class - other plugins could inherit this from the db_mixin.
2)	Developer: Thanks Sridar,
Since plugin inherits service group db and firewall db we cannot move this to firewall db, this require the firewall db to import  service group db which creates a circular dependency.  Point taken we can refractor it later unless if it is major.  
Thanks
Vishnu
3)	Reviewer: Okay that is fair. I agree - anyways with flavors - we will refactor and at that time we can look for the best way to handle this. This is not  a major issue.
Source Code URL: https://review.opendev.org/#/c/106274/16..17/neutron/services/firewall/fwaas_plugin.py@171
2.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I399e1569baae6f24054aac15c4c51a2e44a20e5b
Code Smell Term: circular dependency
Code Smell Discussions: 
1)	Reviewer: Why not release the segment based on its segment_id? Are we sure partial matches will always uniquely identify the segment?
2)	Developer: I assume you mean the record ID? segmentation_id's can be reused across physnets. We still need some segment information to call the type driver's release segment, If i just accept the ID, the type manage will have to get the row from the DB for details for the type driver. I've changed it to a full segment dictionary with the record ID.
3)	Reviewer: I do mean the record ID.
Why not just use the get_segment_by_id() function I added in https://review.openstack.org/#/c/116209/1/neutron/plugins/ml2/db.py?
4)	Developer: Didn't know that was added in, I was planning on adding one myself to db.py but my logic here was that the mech driver or context objects that have access to the dynamic segment record id will have the complete segment dictionary so we can just accept that instead of another DB call to grab the same information.
5)	Reviewer: This get_segment_by_id() is needed to fetch the segment dictionary so mechanism drivers have access to all the properties, but the set_binding() and continue_binding() calls are in terms of just the IDs. I think using just the ID for release_segment() would be most consistent.
6)	Developer: I can change it to depend on your patch for that method but doesn't that create a circular dependency loop?
Refactor part 2 —> DB Changes for HPB —> Driver API for HPB —> Refactor part 2
7)	Developer: Sorry that should go:
Refactor part 2 —> Hierarchical port bindings —> DB Changes for HPB —> Driver API for HPB —> Refactor part 2
8)	Reviewer: No, we can't have a cyclic dependency between patches. Just copy the function into your patch, and it will disappear from mine when I rebase.
9)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/115025/13..14/neutron/plugins/ml2/driver_api.py@156
3.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I24a4c7b300b3e1b11c8b0223b55302654ad3f43e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/102336/3..4/neutron/plugins/brocade/vyatta/vrouter_driver.py@247
4.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I6c8e2ac0ee48be69ab483ebe024313776204504f
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/115389/2..3/neutron/services/firewall/drivers/cisco/csr_firewall_svc_helper.py@92
5.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8537da72b22d248839b58b3430426ebaa0d570e9
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: The commit message says "NotImplementedError is not fatal here". If so, why do we need to raise NotImplementedError here. Isn't it enough just to ignore non-existing methods?
IMO it is not a usual way that we raise NotImplemetnedError inside and then ignore it outside.
2)	Developer: probabaly.
i don't know why this raises an exception in the first place.
this has been dead code until https://review.openstack.org/#/c/87440/ was merged.
and then https://review.openstack.org/#/c/94183/ made this dead again.
Source Code URL: https://review.opendev.org/#/c/110208/2/neutron/agent/l2population_rpc.py@209
6.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9d935cf5e0c231e8cb7af5f61b9a9fc552c3521e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: if "ha" is none, the method returns in the above statement, isn't this dead code?
2)	Developer: 'ha' cannot be None by this line, but since it's a boolean it certainly can be False.
Source Code URL: https://review.opendev.org/#/c/64553/70..71/neutron/db/l3_hamode_db.py@297
7.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I63dd5c01b7910356178335dc207bc5d118adac8f
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/111431/2..3/neutron/plugins/ml2/drivers/cisco/apic/apic_manager.py@183
8.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ic887a93480eca0b56049c67e32c98658e3a4427f
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: dead code removal
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/103593/1..2/neutron/tests/unit/cisco/cfg_agent/test_cfg_agent.py@79
9.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Icead821bb74372b15aac2e5cefe8ad7f08c037ab
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Agreed
Source Code Smell: https://review.opendev.org/#/c/89413/1..2/neutron/agent/l3_agent.py@260
10.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Icead821bb74372b15aac2e5cefe8ad7f08c037ab
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: pull dead code
2)	Developer: Agreed
Source Code Smell: https://review.opendev.org/#/c/89413/2..5/neutron/tests/unit/test_l3_agent.py@415
11.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Icead821bb74372b15aac2e5cefe8ad7f08c037ab
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Sorry - my bad... I meant to update this file along with l3_agent.py but I missed it.  I'll get these resolved in my next patch.
Source Code URL: https://review.opendev.org/#/c/89413/4..5/neutron/tests/unit/test_l3_agent.py@415
12.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I7227fbe2718eba6665a5afb5dcaaaa77b341091f
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Remove dead code in this file...
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/84223/2..3/neutron/tests/unit/test_extension_l3_distributed.py@79
13.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8497256d7f4f2fb48b5cb792e35aaedf63f129fc
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: This can be simplified to return False based on the above logic and resync variable can be removed.
2)	Developer: Thanks for your comment. That would make the code less readable. It would be harder to understand what that return False means.
3)	Reviewer: IMHO, dead code decreases readability. If the purpose of the return value is unclear, I would add a docstring to this method. A docstring would be more descriptive than just a variable name. For example, `"""Returns True if resync with plugin is required."""`
4)	Developer: Ok Amir, I don't feel strongly about it. Actually that boolean is not part of my change, so it should be a separate discussion. Let's hear some other opinion and I will change if somebody else agrees with you. I'd be grateful if you could remove your -1 , the change that you require is a nitpick.
5)	Reviewer: The change does impact the use of the variable. This can be fixed in a later patch, if you insist.
6)	Developer: OK, let's do that. Thanks!
Source Code URL: https://review.opendev.org/#/c/66899/25..26/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py@956
14.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ide9d2bb04016cadb347b00cadbee7007e61bd01e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: This code doesn't appear to be used anywhere.  What is the motivation behind adding this?  If you intend to add calls to this method that set force_up=True it might be better to add this code when you add that.
Otherwise, we have dead code in the repo until someone calls it.
Source Code URL: https://review.opendev.org/#/c/76309/1..2/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py
15.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ica50e69956f0c311b53b82bd52b7929047e8255a
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove if this is dead code.
Source Code URL: https://review.opendev.org/#/c/79285/5..6/neutron/plugins/vmware/agent/vcenter_neutron_agent.py@58
16.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9389f73d51ba1def31c6a25ffcd8cac4f2c545d7
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: dead code removal
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/74194/1..2/neutron/plugins/cisco/l3/db/hosting_device_manager_db.py@575
17.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9389f73d51ba1def31c6a25ffcd8cac4f2c545d7
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: dead code removal
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/74194/1..2/neutron/plugins/cisco/l3/db/l3_router_appliance_db.py@112
18.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I547426f1d4e0d1a305e179a785a5d517d058c381
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: please remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/43793/7..8/neutron/plugins/juniper/contrail/ctdb/config_db.py@1172
19.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I547426f1d4e0d1a305e179a785a5d517d058c381
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: please remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/43793/27..28/neutron/plugins/juniper/contrail/contrailplugin.py@515
20.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If230194f544281131a61c706a7f7c70bdd6c29b6
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code?
Source Code: https://review.opendev.org/#/c/74152/3..5/neutron/plugins/cisco/l3/agent/cfg_agent.py@505
21.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If230194f544281131a61c706a7f7c70bdd6c29b6
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: handle dead code.
Source Code URL: https://review.opendev.org/#/c/74152/3..5/neutron/tests/unit/cisco/l3/test_cfg_agent.py@156
22.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If230194f544281131a61c706a7f7c70bdd6c29b6
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: dead code. See some in other places in this file.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/74152/6..7/neutron/plugins/cisco/l3/agent/csr1000v/csr1000v_routing_driver.py@249
23.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I39b1475c992b594256f5a28be0caa1ee9398050e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: This looks something dead code...
We shouldn't have it if it is not supported now
2)	Developer: OK. I can remove. The device driver doesn't support reuse of policy IDs right now, so I ifdef'ed this out and commented out the UTs for it. I can save those changes away and in the future restore them.
Source Code URL: https://review.opendev.org/#/c/74144/2..4/neutron/services/vpn/service_drivers/cisco_csr_db.py@158
24.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I39b1475c992b594256f5a28be0caa1ee9398050e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: nit: remove dead code
2)	Developer: Will do in next patch for this and all other commented out code. Thanks.
Source Code URL: https://review.opendev.org/#/c/74144/2..4/neutron/services/vpn/service_drivers/cisco_ipsec.py@213
25.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I39b1475c992b594256f5a28be0caa1ee9398050e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: # remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/74144/2..8/neutron/tests/unit/services/vpn/service_drivers/test_cisco_ipsec.py@20
26.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I39b1475c992b594256f5a28be0caa1ee9398050e
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/74144/2..4/neutron/tests/unit/services/vpn/service_drivers/test_cisco_ipsec.py@299
27.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I96eb443cf03b40171bef8580ae52a6837178e27f
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: It seems it is a exact copy of get_tenant_
id_for_create in db_base_plugin. If so honor DRY policy.
I see many code copy in this class (here to L.149). Please avoid duplicated codes.
2)	Reviewer: I think this class should just inherit CommonDbMixin
Source Code URL: https://review.opendev.org/#/c/51306/7..8/neutron/services/loadbalancer/drivers/brocade/device_inventory/brocade_adx_device_inventory.py@87
28.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I5a0f2a696cd7a3ec59d0ece375a7a658e1853032
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: Please consider changing L501-527 to the following:
  if (is_public and
      [subnet.ipv6_ra_mode, subnet.ipv6_address_mode]
      in (onstants.DNSMASQ_PUBLIC_MODES):
      commands = self.spawn_process_ipv6_public(...)
  elif (not is_public and
        [subnet.ipv6_ra_mode, subnet.ipv6_address_mode]
        in constants.DNSMASQ_NON_PUBLIC_MODES):
      commands = self.spawn_process_ipv6_non_public(...(
  else:
      LOG.debug(...)
      continue
It can avoid the duplicated code.
2)	Developer: Good point! Done. Will be included in Patch 15. Thanks!
Source Code URL: https://review.opendev.org/#/c/70649/14..15/neutron/agent/linux/dhcp.py@500
29.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I83f2a5d2af42164c42773b385ba7b00872eed54e
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: Duplicated code. Maybe add a property to RouterInfo is better:
  class RouterInfo(object):
    @property
    def keepalived_instance(self):
        return self.keepalived_manager.config.get_instance(
            HA_VIRTUAL_ROUTER_NAME_PREFIX + str(self.ha_vr_id))
2)	Developer: I removed the code duplication by doing something a tad differently: get_instance now accepts only a ha_vr_id and lookup is done by that id. The names are auto-generated from the id.
Source Code URL: https://review.opendev.org/#/c/70700/9..10/neutron/agent/l3_agent.py@774
30.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Icead821bb74372b15aac2e5cefe8ad7f08c037ab
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: I think lines 497-548 can do with a bit of improvement as there's lots of duplicated code; for instance, I'd break the destroy_*_namespace function in two methods: one that does the unplugging and one that does the cleanup. For now, please go ahead and address my comments below. We can work out a better shape of the code later.
Source Code URL: https://review.opendev.org/#/c/89413/25..27/neutron/agent/l3_agent.py@497
31.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I7227fbe2718eba6665a5afb5dcaaaa77b341091f
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: Suggestion : Maybe create a device_owner variable and use it in the port.update method to have less duplicated code. You could create it at #317 and use it here and line #372
Source Code URL: https://review.opendev.org/#/c/84223/4..5/neutron/db/l3_db.py@343
32.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Icd5907e7c1692668bcdf3884083e11be17554dec
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: consider passing plugins parameters for PluginAwareExtensionManager (389-390) to super.setUp(). Then you can remove duplication (374-391)
2)	Developer: It seems lines 374-380 are necessary for lines 385-386.
As reduction in duplicated code is small, I'd like to keep this as is.
3)	Reviewer: Yes, 374-380 are necessary and super class setUp() has these lines as well, so now they are executed twice - here and then in super class setUp(). Still think you can add a parameter 'plugins' needed for extension manager and just call super class setUp() with proper parameters
4)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/73962/4..5/neutron/tests/unit/db/loadbalancer/test_db_loadbalancer.py@389
33.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ie7c75c71c9dcfbd9feabaffe4416ede80ff350d8
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: a lot of duplicated code between test_create_firewall_no_rules and test_create_firewall_no_rules_v6,  Consider refactor to one helper method and call it from these 2 tests.
Source Code URL: https://review.opendev.org/#/c/63981/5..6/neutron/tests/unit/services/firewall/drivers/linux/test_iptables_fwaas.py@179
34.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ibfeb54c4402943fb3696a1c599fa373e42e520d4
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: In the four CRUD methods, there is quite a bit of duplicated code. Consider refactoring - maybe extracting more into a common method?
Source Code URL: https://review.opendev.org/#/c/57524/1..6/neutron/services/loadbalancer/drivers/netscaler/ncc_client.py@68
35.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Idae77886bd195d773878c3d212ccfd56269216fb
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: a lot of duplicated code in two added test cases. Consider refactor to one helper method and call it from these 2 tests.
2)	Developer: The only difference in the test is that different parameters are passed to the routine under test.  Will refactor as suggested in the next patch.
Source Code URL: https://review.opendev.org/#/c/30988/30..31/neutron/tests/unit/test_l3_agent.py@859

1.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I097b1c441df1f7f1785b8744f27809617bb21c14
Code Smell Term: circular dependency
Code Smell Discussions: 
1)	Reviewer: This stuff could probably just be moved to impl_idl to avoid the ovs_lib -> ovsdb -> ovs_lib circular dependency.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/194713/5..6/neutron/agent/common/ovs_lib.py@99
2.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Id0822f1c3d586c813a09e4b442a21d3cb52943d0
Code Smell Term: circular dependency
Code Smell Discussions: 
1)	Reviewer: Do you think this method should live in the router class as a factory method (e.g. standalone method that creates a DVR router or regular router, based on distributed flag)?
2)	Developer: I thought of doing that.  However, I didn't think that the base router class should or even can be aware of the DVR and HA routers (circular dependency).  I think at some point we could abstract this out to a separate manager or factory class in its own module.  For now, it is fine here.  This gets us almost all of the way there by confining the knowledge of the various classes to a single place.
Source Code URL: https://review.opendev.org/#/c/142863/8..9/neutron/agent/l3/agent.py@394
3.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9259d9679c74d3b3658771290e920a7896631e62
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: you can remove "pass", it's commonly considered as dead code by coverage tool
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/204436/46..47/neutron/extensions/availability_zone.py@132
4.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If2962580397d39f72fd1fbbc1188a6958f00ff0c
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/196893/12..13/neutron/agent/l3/dvr_edge_ha_router.py@120
5.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If2962580397d39f72fd1fbbc1188a6958f00ff0c
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: See PS12 comment. dead code still there.
Source Code URL: https://review.opendev.org/#/c/196893/14..16/neutron/agent/l3/dvr_edge_ha_router.py@120
6.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ib008ed87162f0fbb0818ddd56cc70aa4b03ffa8d
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Where is it called? It looks like dead code
Source Code URL: https://review.opendev.org/#/c/202388/3/neutron/tests/functional/agent/l2/base.py@138
7.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ibc6ff897a1a00665a403981a218100a698eb1c33
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Is this dead code (if so remove), code to be reworked (WIP), or some documentation (maybe add "Note:..."
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/129773/17..18/neutron/tests/unit/api/v2/test_attributes.py@914
8.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Id7bb7d7860859283b53f588a940ca21c94fd0e6a
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Related-Bug: #1468493
2)	Developer: Sorry why is this related to that bug? This patch is removing unused options not unifying anything with the OVS agent conf.
3)	Reviewer: Right but I think the bug is pertinent since we are removing configuration options on the linux bridge side, we're going to need to document how to use the ML2 configuration variables for tenant vlan ranges and tenant segmentation type now that the LB plugin has been removed.
4)	Developer: The LB monolithic plugin was removed in the Juno release. These configuration options haven't been used for two entire cycles... This patch doesn't remove any configuration options, it's removing dead code / options that aren't used anywhere at all.
5)	Reviewer: OK - that makes sense then. sorry for the trouble
Source Code URL: https://review.opendev.org/#/c/196765/2..3//COMMIT_MSG@12
9.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8230dc0ee30efef236b6827dd7116aba88df79de
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Was this all just dead code?  I don't see it being useful for anything.
2)	Developer: Yes it is dead code, which was used before the old --dhcp-script was removed.
Source Code URL: https://review.opendev.org/#/c/108272/4/neutron/agent/linux/dhcp.py@a776
10.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8230dc0ee30efef236b6827dd7116aba88df79de
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: I'm glad you clean up dead code here, though it would be better to see it as a separate patch.
2)	Developer: Let's split this patch in to a dead-code patch and new code patch.  We need to get past the current impasse.  Splitting them up will reduce the surface area of the patch.
Source Code URL: https://review.opendev.org/#/c/108272/6/neutron/agent/linux/dhcp.py@a316
11.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8230dc0ee30efef236b6827dd7116aba88df79de
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: ^ dead code too, ok. (see link @ line 775)
Source Code URL: https://review.opendev.org/#/c/108272/6/neutron/agent/linux/dhcp.py@a355
12.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8230dc0ee30efef236b6827dd7116aba88df79de
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Ok, this was dead code from https://review.openstack.org/#/c/37580/
Source Code URL: https://review.opendev.org/#/c/108272/6/neutron/agent/linux/dhcp.py@a775
13.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ieb565a2d2629ab8236a4be1173df464b7aa06f04
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: "pass" will be considered as dead code by coverage tools
2)	Reviewer: What are you suggesting?
3)	Reviewer: remove them as there are not required when a docstring is provided
4)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/134339/22..24/neutron/ipam/ipam.py@248
14.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I03c61b9e7232e4f753b73b732ab4c1ec12fb0dbe
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: remove dead code
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/115431/8..9/neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_rest_routing_driver.py@182
15.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If02c4761d9653dcd81fc0043ecce86a3b149dd99
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: I don't think that this should be done in this way. Another migration should be created to drop this tables from db.
2)	Developer: hm from what I can see, migrate_to_ml2 drops these tables for Icehouse but not for Juno.
So, I'm thinking tat this removal should still be done, since those tables are no longer needed and it will just be dead code / tables, plus, the Hyper-V model will no longer exist, neither will the consumer (HyperVNeutronPlugin).
Also, I'm not sure about having a migration to drop these tables from db... users might still have data inside those tables, which will be lost, especially if they did not get to run the migrate_to_ml2 script.
3)	Reviewer: Existing migrations should not be changed. If we need to change db scheme somehow we need to create another migration that will do such changes. If we want to save data from tables, it should be moved.
I really don't like the idea, that people that do upgrade to Kilo from Juno will have some tables from nowhere.
For example, there are migrations for removing mlnx plugin https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/28c0ffb8ebbd_remove_mlnx_plugin.py and cisco nexus plugin https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/1680e1f0c4dc_remove_cisco_nexus_plugin.py
Source Code URL: https://review.opendev.org/#/c/153394/1/neutron/db/migration/alembic_migrations/other_plugins_init_ops.py@a27
16.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If02c4761d9653dcd81fc0043ecce86a3b149dd99
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: This file should not be modified.
2)	Developer: I get the meaning of frozen.. but why not? :)
The neutron/plugins/hyperv/model.py file is being removed, so those tables represent False data. Also, its consumers (HyperVNeutronPlugin) will be removed, so it will just be dead code.
3)	Reviewer: db healing migration is based on this file.
The basic idea of migrations is having all changes one after another, so migration should always rely on one exact content.
Source Code URL: https://review.opendev.org/#/c/153394/1/neutron/db/migration/models/frozen.py@a997
17.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I1b729241aa76b2dcb053b51c69d28e1c5359b4f7
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Remove dead code.
Source Code URL: https://review.opendev.org/#/c/145829/5..7/neutron/tests/unit/test_agent_linux_utils.py@48
18.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I1b729241aa76b2dcb053b51c69d28e1c5359b4f7
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Please see comments from PS5
2)	Developer: Dead code, we don't like you! ;)
Source Code URL: https://review.opendev.org/#/c/145829/6..7/neutron/tests/unit/test_agent_linux_utils.py@48
19.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I2c1b5bc9cb6b9860676bb5e3eaca0402d7e99b01
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: pass is considered as dead code by python coverage tool
2)	Reviewer: a method requires at minimum either a docstring or a 'pass' statement to be considered valid.  If you follow Cedric's suggestion of adding docstrings to all abstract methods in this class, then pass won't be required for any of them.
3)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/143709/14..15/neutron/agent/ovsdb.py@83
20.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9ceb9c22c7467c07f62fdd293d57b393b8a451e9
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Dead code? If so remove.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/92541/1..2/neutron/db/trunk_port_db.py@156
21.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9ceb9c22c7467c07f62fdd293d57b393b8a451e9
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: dead code?
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/92541/1..2/neutron/db/trunk_port_db.py@206
22.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I9ceb9c22c7467c07f62fdd293d57b393b8a451e9
Code Smell Term: dead code
Code Smell Discussions: 
1)	Reviewer: Dead code? If so, remove.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/92541/1..2/neutron/extensions/trunk_port.py@67
23.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I88742e4d454709e35481f2c505c9d64995497cac
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: why this duplication needed?
2)	Developer: I will remove duplicated code and I will make some rework in next PS.
Source Code URL: https://review.opendev.org/#/c/230537/11..12/neutron/tests/functional/agent/l2/base.py@97
24.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If6dba1197b3f08ecc0ac01fcf085c8268f81169f
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: The old logic seems to check if the tap device is in a managed bridge. Your logic here seems only check if the tap device is in any bridge. I think code can be improved here.
Also, I see duplicated code in line 441~442 and  448~449. Maybe you can eliminate them.
Source Code URL: https://review.opendev.org/#/c/242260/1..2/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py@438
25.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If697c4c4c09d32abd410ac1fce4d8a6a0d337da1
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: We probably should add a 
def _route_cmd_helper(self, ip_version, args=None) and then copy 708-714 which would allow us to remove the duplicated code between these methods. 
We could also add another helper method to remove the duplicated code above which only differs on one line but you can ignore that if you want.
2)	Developer: Fair enough.  Done.
Source Code URL: https://review.opendev.org/#/c/219038/4..5/neutron/agent/linux/ip_lib.py@707
26.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ic99193a0a2669fb281759d9b47c7aae6a4f6ecce
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: nit: a lot of duplicated code in test_not_slaac and test_is_slaac method below. Can we use a loop instead?
2)	Developer: Will do in next patch.
Source Code URL: https://review.opendev.org/#/c/144399/4..5/neutron/tests/unit/test_ipv6.py@112
27.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I7e4641f47790414c693c7cc9b7a44b1889087801
Code Smell Term: long method
Code Smell Discussions: 
1)	Reviewer: style nit:  I always prefer this:
  if not quota:
      return
  ...
It reduces indentation and I always like a quick return if we've decided we don't have anything else to do in the method.  As a code reader, it means I don't have to scroll down a potentially long method to see if there is an "else" hanging out down there.
2)	Reviewer: I'm ok either way.
I know of another cult that don't like negative conditions though ;)
3)	Reviewer: Feel free to ignore all of my nits.  ;)  I don't vote negatively for them.  I just add them in case you're interested.
Source Code URL: https://review.opendev.org/#/c/165264/5..6/neutron/ipam/subnet_alloc.py@81
28.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ic0c6ed4dba74da94a75838178a1837f93d2d0885
Code Smell Term: middle man
Code Smell Discussions: 
1)	Reviewer: nit:  I'm not too thrilled about reordering these arguments.  The result of this method when allocation_pools is None is essentially a direct call to ipam_utils.generate_pools(cidr, gateway_ip).  Why not avoid changing this and cut out the middle man in this case?  Or, if you want to keep the encapsulation in this file, create a new method as a thin wrapper:
  def generate_pools(cidr, gateway_ip):
      return ipam_utils.generate_pools(cidr, gateway_ip)
It would reduce a bit of the noise in this patch where callers had to reorder their arguments.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/158697/60..61/neutron/db/ipam_backend_mixin.py@337
29.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I61beb2d663dfa6070b529b567d79664b1cb69810
Code Smell Term: spaghetti code
Code Smell Discussions: 
1)	Reviewer: This looks to me like yet another collateral change.
2)	Developer: This variable name change was in response to previous review comments saying that the use of 'found' felt like spaghetti code. After I split this patch up, let's see if this name change is acceptable in a smaller patch.
Source Code URL: https://review.opendev.org/#/c/113339/22..23/neutron/db/db_base_plugin_v2.py@377

1.  Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I14702ddcc5c32ba34b5f905a15cd816a69ef2b49
      Code Smell Term: bad naming
      Code Semll Discussions: 
      1)      Revuwer: that's probably an indication of a bad naming choice.
      Source Code URL: https://review.opendev.org/#/c/369550/7..9/neutron/plugins/ml2/drivers/type_vxlan.py@22
2.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ieab53624dc34dc687a0e8eebd84778f7fc95dd77
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: now that we have it in two places (dvr fip code and here), should we have a common function to do it, that would just receive an argument with desired value?
2)	Developer: Done, I had to put it to ip_lib as to agent.linux.utils introduced a circular dependency.
Source Code URL: https://review.opendev.org/#/c/393886/10..11/neutron/agent/l3/ha_router.py@34
3.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I7be4ce2513e49e6da46a7bdffb8538613f0be7c7
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: Please, add a link to the patch set that introduces the circular dependency.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/330870/11..12//COMMIT_MSG@10
4.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I67c1323267aaf7e49f4a359ff50b94e52dba4380
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Developer: actually that is more correct if we start with an empty cache and we force a DB lookup on any update/request, do not necessarily an artifact of removing the circular dependency issue.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/268040/9..10/neutron/api/rpc/callbacks/version_manager.py@143
5.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I67c1323267aaf7e49f4a359ff50b94e52dba4380
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: why would you want to proactively update the list now and not postpone it till get_ is triggered?
2)	Developer: Because
For two reasons:
1) If I get an update at boot, it's worth taking the DB details, and then squash the update in, so when the get happens "we already now"
and more important
2)
3)	Developer: To keep L166 None, and fill it on first use. Otherwise, I trigger the circular dependency at module load because of  L174, another option would be returning CacheResourceConsumerTracker to a singleton :)
4)	Developer: I will remove this, as, on an initial update all servers could sync and hit the database at the same time very quickly.
Source Code URL: https://review.opendev.org/#/c/268040/12..13/neutron/api/rpc/callbacks/version_manager.py@170
6.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I4abd45252026431452f0d2cb2805043489c2f6ad
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: nit but this should be defined in the extension
2)	Developer: It causes a circular dependency if I do
Source Code URL: https://review.opendev.org/#/c/233306/23..24/neutron/services/auto_allocate/db.py@43
7.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Id675910c2a0b862bfb9e6f4fdaf3cd9fe337e52f
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: I wonder if by paginating we're just masking the lack of proper garbage collection. Besides, what if 200 is 'big' enough for a system to experience the same 'fatal memory consumption'?
I wonder if there's some circular dependency that prevents GC to kick in. I remember we had similar issues on memory ballooning during unit tests. Those were successfully fixed by switching to weak references.
2)	Developer: >> I wonder if by paginating we're just masking the lack of proper garbage collection.
I suspect the problem might lie at messaging level: when server is ready with a (giant) response the agent already timeouted and sent another request for routers info, so we have kind of cascading effect. The server might do several attempts to send the response (with some timout) with no success before throwing it off, so memory is used all that time. Anyway even if we fix garbage colection at messaging (or any other) level we'll still have a problem with heavy requests which server fails to process in required time. And I see it as the main problem.
>> Besides, what if 200 is 'big' enough for a system to experience the same 'fatal memory consumption'
so that's why this is configured parameter ;)
>> I wonder if there's some circular dependency that prevents GC to kick in. I remember we had similar issues on memory ballooning during unit tests. Those were successfully fixed by switching to weak references.
I see the problem comes from the db request: 
SELECT routerports.router_id AS routerports_router_id, routerports.port_id AS routerports_port_id, routerports.port_type AS routerports_port_type, ipallocations_1.port_id AS ipallo
cations_1_port_id, ipallocations_1.ip_address AS ipallocations_1_ip_address, ipallocations_1.subnet_id AS ipallocations_1_subnet_id, ipallocations_1.network_id AS ipallocations_1_network_id, ports_1.tenant
_id AS por....
which has list of parameters with ~1000 items when agent requests info for all router it handles. The response size is about 2G, after reading the response process starts to call mmap() retrieving more memory.
overall the processing takes several minutes.
Source Code URL: https://review.opendev.org/#/c/234067/1..4/neutron/agent/l3/config.py@105
8. 	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I3b33af236d816e1ef93d6d81804fab82092671ca
	Code Smell Term: complex conditionals
	Code Smell Disucssions: 
	1)	Reviewer: I really strongly preferred the two methods you had in PS17. Yeah, it's a few more lines of code and the 		methods look similar but it is much more straight-forward. I'm sorry that feedback on PS17 led you to this. I just 			find methods like this harder to read because I have to parse the overly complex condition on L40 - L41
		IMO, combining two methods that just happen to look similar and adding extra arguments and complex 				conditionals to the method so that it can do both jobs is never a good strategy to reduce code duplication.
	2)	Developer: done, revert back to patch set 17.
	Source Code URL: https://review.opendev.org/#/c/265672/20..21/neutron/agent/l3/ha_router.py@36
9.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If3dd94a46bdee24c13d1f17c4f2e69af0cb8af63
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: This probably doesn't hurt but is it strictly necessary? Did you hit a problem with it?
As far as I can tell, if this weren't added and "subnet_id not in ip_pools" then we'd get an empty set on L73 because of the defaultdict. We'd build filter_set unnecessarily on L75-L77 (but it won't be very big so it isn't a big deal), then we'd do a couple of trivial set differences, and finally we'd continue anyway on L84. So, if I'm right, this change boils down to an optimization who's merit is questionable because I don't really see any real algorithm complexity improvement.
If it is all the same, I think I'd rather take this change out of here and post it as a separate patch set to discuss it.
Not to mention, this is dead code anyway since the change to use pluggable IPAM everywhere. :)	
2)	Developer: You're right, this is an optimization. I added it to avoid adding unnecessary iterations due to the change on L70 - which is necessary to preserve the order of preference. As you say, with the switch to pluggable ipam this no longer actually improves anything important, so I'm happy to remove it.
Source Code URL: https://review.opendev.org/#/c/350613/8..9/neutron/db/ipam_non_pluggable_backend.py@72
10.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If08b304a9388058003d9f86f58295c6b5daef846
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: It means we initialize quite[1] every driver even if there are unused => dead code running
[1] at most one per vif_type
2)	Developer: Yes. There was not a clean way to check whether a driver is already initialized or not, and doing it at release time is not feasible too!!!
Source Code URL: https://review.opendev.org/#/c/245137/14/neutron/plugins/ml2/managers.py@181
11.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ib5ef2cc23a48f092ebebe9a7d5ab753c9b9a33df
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: dead code?
2)	Developer: Yep, thanks.
Source Code URL: https://review.opendev.org/#/c/292829/10..11/neutron/objects/extensions/standardattributes.py@26
12.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I920815a5c61df1d85664e14e1b9544795a922884
Code Smell Term: dead code
Code Smell Discussions:
1)	Developer: note to reviewers. This was dead code before. Now this patch has made it reachable so this change is to actually preserve the previous error code even though it looks like it's changing.
Source Code URL: https://review.opendev.org/#/c/226665/4/neutron/api/v2/base.py@699
13.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If9a7e2c4c45c395b8e93bd1293667bf67f53dcfa
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: remove useless pass, in general coverage consider them as dead code.
2)	Developer: Done
Source Code URL: https://review.opendev.org/#/c/207635/29..32/neutron/agent/bgp/driver/base.py@38
14.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Idf516ed9db24d779742cdff0584b48182a8502d6
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: This is dead code, no?
Source Code URL: https://review.opendev.org/#/c/279378/5..6/neutron/db/db_base_plugin_v2.py@613
15.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Idf516ed9db24d779742cdff0584b48182a8502d6
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: On L610 we raise BadRequest in cidr is not set.  On L612, we return if cidr is set.  So, the rest of this code is unreachable or dead code.
Source Code URL: https://review.opendev.org/#/c/279378/5..6/neutron/db/db_base_plugin_v2.py@619
16.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Id305d9a583116e155441ac5979bf3f6aa6a8258b
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: Indented too much.  As it is, this is dead code.  :(
2)	Developer: Oops, that's not what we want.  Pull this back 4 columns
Source Code URL: https://review.opendev.org/#/c/207607/52..53/neutron/db/bgp_dragentscheduler_db.py@94
17.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I295dc79031a0547f8687c5835c7ba7bbc43df36d
Code Smell Term: dead code
Code Smell Discussions:
1)	Reviewer: dead code
2)	Developer: Done.
Source Code URL: https://review.opendev.org/#/c/202098/6..7/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py@1458
18.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I5160d0ab9e8042c356229420739db0ce42842368
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: Shouldn't be better to create sorts as argument and has this logic in the base class?
2)	Developer: If you mean that default sorting parameters should be declared on objects, yes. And I have a TODO for just that in some other place. It's work for a follow up.
If you mean that we need another argument for sorting, then no, we already have _pager for that.
3)	Reviewer: Well, I was thinking something like this in the NeutronDbObject base class:
    def get_objects(cls, context, _pager=None, _sorts=None, **kwargs):
        ...
        if not _pager:
            _pager = cls.Pager()
        if not _pager.sorts and _sorts is not None:
            _pager.sorts = _sorts
4)	Developer: No, we don't want to add another argument for sorts. What next? Limit? Page_reverse? Pager is enough, it encapsulates all features.
5)	Reviewer: I don't like to add another argument either, but it seems like more classes are sharing the same logic[1], so eventually we'll have duplicated code which is worst that adding arguments
[1] https://review.openstack.org/#/c/351368/24/neutron/objects/ports.py@142
6)	Developer: We should be able to tackle that without changing objects API in a duplicating way.
Source Code URL: https://review.opendev.org/#/c/269658/24..25/neutron/objects/network.py@64
19.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Ie8beeccf2294f1af8baa758eba230da2de1fff28
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: There is so much of this that is almost duplicated code of 'update_network'. Why can't you just make the changes required to enable this _reserve_segment function call 'update_network'?
2)	Developer: Yeah, this method and _release_segment can be seen as "update the segment of network". So, it is nature to have duplicated logic with update_network. Since it is brought out, I will give it a try to eliminate the duplication.
Source Code URL: https://review.opendev.org/#/c/317358/7..8/neutron/plugins/ml2/plugin.py@1753
20.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If08b304a9388058003d9f86f58295c6b5daef846
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: it seems there is a lot of duplicated code between tests
2)	Developer: Done. Refactored code heavily to reduce duplication.
Source Code URL: https://review.opendev.org/#/c/245137/11..12/neutron/tests/unit/plugins/ml2/test_plugin.py@1285
21.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I54a736d91de52dda85c559b9e6103199f914abdf
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: Where is this method used?
2)	Developer: _create_network() is called in line 501 by the self.network() method. It looks like that calls the _make_network() method in test_db_base_plugin_v2.py, which in turn calls _create_network()
3)	Reviewer: Why did you re-create most duplicated code? For example, you can override a part of the method like [1] OR you can use arg_list like [2].
[1]: https://github.com/openstack/neutron/blob/master/neutron/tests/unit/extensions/test_external_net.py#L48-L56
[2]: https://github.com/openstack/neutron/blob/master/neutron/tests/unit/extensions/test_portsecurity.py#L182
4)	Developer: Agreed, those are much better solutions. I've implemented the former now.
Source Code URL: https://review.opendev.org/#/c/277597/2..3/neutron/tests/unit/extensions/test_dns.py@60
22.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~If6df55df2a362813d63405beba62518f38841bff
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: Why do you keep this method? It seems just a copy from get_active_network_ids, but I also can't find where will it be used.
Maybe you're worried about backward compatibility, if so, sorry for my previous comments on PS8 to change RPC method name.
But at least, I don't think duplicated code is a good idea.
2)	Developer: There are quite a good number of dhcp scheduler UTs which are referring to get_active_networks method. They failed as I modified the method name.
3)	Reviewer: I don't think it is a good idea, either. The UTs could be fixed then.
Source Code URL: https://review.opendev.org/#/c/219573/10/neutron/api/rpc/handlers/dhcp_rpc.py@126
23.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I6230d8d09f77bd20674bf6c3be69fbc1627d66f8
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: A lot of duplicated code
2)	Developer: I moved some code to base class and now should be less duplicates :)
Source Code URL: https://review.opendev.org/#/c/248938/4..5/neutron/tests/fullstack/resources/machine.py@124
24.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I8c462a4ee6f60ef716bf9e4d7f83a35c7e1dead0
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: please add a unit tests for the new method
2)	Developer: I think that this method should (if not already) be tested together with the rest of the extensions loading process.
Adding this test to each extension which override this method will end up in duplicated code and the same procedure will be tested couple of times with the same inputs.
Source Code URL: https://review.opendev.org/#/c/261338/1..2/neutron/extensions/securitygroup.py@337
25.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I579d66ec734627dec08df6fba750a3e237600a5c
Code Smell Term: duplicated code
Code Smell Discussions: 
1)	Reviewer: Why not removing ALL duplicated code?
 def _update_arp_entry(self, context, payload, action):
   router_id = payload['router_id']
   ri = self.router_info.get(router_id)
   if not ri:
     return
   arp_table = payload['arp_table']
   ip = arp_table['ip_address']
   mac = arp_table['mac_address']
   subnet_id = arp_table['subnet_id']
   ri.update_arp_entry(ip, mac, subnet_id, action)
 def add_arp_entry(self, context, payload):
   self._update_arp_entry(context,payload, 'add')
 ...
2)	Developer: Thanks, it's more clear.
Source Code URL: https://review.opendev.org/#/c/266348/3..4/neutron/agent/l3/dvr.py@52
26.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I663f1264fb3963789b79a4a7c3e46d232b2f0620
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: This seems to be the main thing missing from the _delete version of this call.  (This and the defer_apply call)
There does seem to be just enough duplicated code to worry me a little.  However, I do like the removal of the 'delete' parameter.  I'd rather try to find a way to remove code duplication locally rather than throwing the delete parameter up to the top caller like was done before this patch.
The way I can think of to do it is itself a little bit ugly but at least it would keep it local.  It is something like creating a contextlib.contextmanager method that would yield back to the caller to do the iptables stuff.  Both the process_external and the process_external_on_delete methods would call it.  The _delete version of the code would just pass.  I'll admit it isn't super either.
2)	Developer: I'm open to exploring further optimizations in follow on patches
Source Code URL: https://review.opendev.org/#/c/251502/12..13/neutron/agent/l3/router_info.py@678
27.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~Iba5d54efa7f99ed82275ffc8e5be975b373c29d3
Code Smell Term: long method
Code Smell Discussions:
1)	Reviewer: (No action required) I am probably not used to ipam code, but the size of the function makes me cry and bite finger nails.
2)	Developer: I'm sorry to make you cry. I'm not going to refactor for this patch at this time. Maybe later.
3)	Reviewer: Definitely not as part of the fix.
4)	Developer: I don't intend to refactor at this time as a prerequisite or a follow up either. I have a hard time breaking up methods just for the sake of making them shorter because it seems to just spread the logic around. There are many good reasons to restructure and simplify a piece of code: separation of concerns, good code reuse, better testability, .... There are certainly others that I didn't list here. But, "make it shorter" doesn't sound to me like a worthy goal on its own. Sure, a very long method is often an indicator that the method could improve in one of these other areas. But, it would help me more if you could point out what a better code structure would be and why.
We might get a little in testability. But, honestly the only tests I can think of that would operate on a small part of this method in isolation feel contrived to me.
If you have an idea. I'd welcome the chance to review any suggestion you have for a follow up.
Source Code URL: https://review.opendev.org/#/c/372794/1..2/neutron/db/ipam_backend_mixin.py@418

1.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I04e155cb92be65f4d5e8e9a4c21e6ca736aff82c
Code Smell Term: circular dependency
Code Smell Discussions:
1)	Reviewer: Why are we importing inline here; is there a circular dependency or something? If so maybe it's worth a comment.
2)	Developer: Moved import to proper place.
Source Code URL: https://review.opendev.org/#/c/321001/13..14/neutron/tests/unit/db/test_ipam_pluggable_backend.py@702

1.	Code Change URL: https://review.opendev.org/#/q/openstack/neutron~master~I009dae9e7f485641f2f19dce8dd575da04bfb044
Code Smell Term: duplicated code
Code Smell Discussions:
1)	Reviewer: Sorry, I caught the change in the code, but this is also duplicated code.  Could be 'if not address_scopes or no_external:'
2)	Developer: Yes
Source Code URL: https://review.opendev.org/#/c/558012/2..3/neutron/tests/functional/agent/l3/test_dvr_router.py@1538
